<?php
/*前台方法*/
/**
 * 加载ACTION文件
 * @param $action
 * @return 加载ACTION的实例
 */
function loadAction($action){
	require DR.'/require/'.$action.'.php';
	$action = ucfirst($action);
	if (class_exists($action)) { 
		$act = new $action();;
		return $act;
	}
}
function template($page,$data=null){
	global $sysinfo;
	if(sizeof($data)>=1){
		extract($data);
	}
	//设置默认的模版地址
	define('HT','http://'.$_SERVER['HTTP_HOST'].'/themes/'.$sysinfo['fr_theme'].'/');
	if(is_array($page)){
		foreach($page as $p){
			require DR.'/themes/'.$sysinfo['fr_theme'].'/'.$p.'.php';
		}
	}else{
		require DR.'/themes/'.$sysinfo['fr_theme'].'/'.$page.'.php';
	}
}
function getSys($key){
	require DR.'/config/sys.php';
	return $$key;
}
function incTemplate($page){
	$c_lang = getLang();
	return DR.'/template/default/'.$page.'.php';
}
function loadinc($inc){
	return DR."/inc/".$inc.".php";
}
